import { createRouter, createWebHashHistory } from 'vue-router'

import Index from '../pages/Index.vue'
import HomeView from '../views/HomeView.vue'
import majorView from '../views/majorView.vue'
import courseView from '../views/courseView.vue'
import peixunView from '../views/peixunView.vue'
import sucaiView from '../views/sucaiView.vue'
import newsView from '../views/newsView.vue'
import newsdetail from '../views/newsdetail.vue'
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            name: 'index',
            redirect: '/site/home',
            component: Index,
            children: [
                {
                    path: '/site/home',
                    name: 'home',
                    component: HomeView
                },
                {
                    path: '/site/major',
                    name: 'service',
                    component: majorView
                },
                {
                    path: '/site/peixun',
                    name: 'peixunView',
                    component: peixunView
                },
                {
                    path: '/site/course',
                    name: 'course',
                    component: courseView
                },
                {
                    path: '/site/sucai',
                    name: 'sucaiView',
                    component: sucaiView
                },
                {
                    path: '/site/news',
                    name: 'newsView',
                    component: newsView
                },
                {
                    path: '/site/newsdetail',
                    name: 'newsdetail',
                    component: newsdetail,
                    meta: {
                        activePath: '/site/news'
                    }
                },
            ]
        },
    ]
})

export default router
